package com.detection.yolo.utils;

import com.detection.yolo.constant.Constants;
import com.detection.common.config.DetectionConfig;
import org.apache.commons.lang3.StringUtils;

import java.io.IOException;

public class FileUploadUtils {

    public static final String getPathFileName(String uploadDir, String fileName) throws IOException
    {
        int dirLastIndex = DetectionConfig.getProfile().length() + 1;
        String currentDir = StringUtils.substring(uploadDir, dirLastIndex);
        return Constants.RESOURCE_PREFIX + "/" + currentDir + "/" + fileName;
    }
}
